cmake_minimum_required(VERSION 3.8)
project(topic_example)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(serial_driver REQUIRED)
find_package(moveit_ros_planning_interface REQUIRED)

# add_executable(path1 src/path1.cpp)
# ament_target_dependencies(path1 rclcpp moveit_ros_planning_interface)

add_executable(sub_node src/sub_node.cpp) 
			    # src/mbot_linux_serial.cpp)
ament_target_dependencies(sub_node rclcpp moveit_ros_planning_interface serial_driver)

add_executable(demo src/demo.cpp)
ament_target_dependencies(demo rclcpp moveit_ros_planning_interface serial_driver)

# add_executable(interchange_node src/interchange_node.cpp 
# 			    src/mbot_linux_serial.cpp)
#   ament_target_dependencies(interchange_node rclcpp moveit_ros_planning_interface)

add_executable(listener_sub src/listener_sub.cpp)  
ament_target_dependencies(listener_sub rclcpp moveit_ros_planning_interface)

# add_executable(listener_pub src/listener_pub.cpp)  
# ament_target_dependencies(listener_pub rclcpp moveit_ros_planning_interface)

# 安装可执行文件
# install(TARGETS sub_node receive_node interchange_node listener_sub listener_pub
install(TARGETS listener_sub demo sub_node
  DESTINATION lib/${PROJECT_NAME}
)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
